#ifndef		_TASK_H_
#define		_TASK_H_

#include	"common.h"
#include	"paging.h"
#include	"dt.h"

#define		KERNEL_STACK_SIZE	2048
#define		DEFAULT_QUANTA		150

#define		TASK_READY		0x01
#define		TASK_BLOCK		0x02
#define		TASK_EXIT		0x04
#define		TASK_ZOMBIE		0x08

struct task{
	int id;
	u32int esp, ebp;
	u32int eip;
	struct page_directory *page_dir;
	u32int kernel_stack;
	u32int user_stack;
	u8int quantum;
	u8int status, wchan;
	struct task *next;
};

void init_tasking();
void sched();
void task_switch(int flag_force);
void move_stack(void *new_stack_start, u32int size);
void switch_to_usermode();
int fork();
int getpid();

#endif		/* _TASK_H_ */
